package cn.iocoder.yudao.framework.magic.config.config;

import cn.iocoder.yudao.framework.magic.api.MagicApiExcuse;
import cn.iocoder.yudao.framework.magic.config.function.DateFunction;
import cn.iocoder.yudao.framework.magic.config.function.LocalDateTimeFunction;
import cn.iocoder.yudao.framework.magic.config.function.MapFunction;
import cn.iocoder.yudao.framework.magic.config.interceptor.AuthorizationInterceptorCustom;
import cn.iocoder.yudao.framework.magic.config.interceptor.RequestInterceptorCustom;
import cn.iocoder.yudao.framework.magic.config.interceptor.SQLInterceptorCustom;
import cn.iocoder.yudao.framework.magic.config.interceptor.TableInterceptorCustom;
import cn.iocoder.yudao.framework.magic.core.MagicApiExcuseImpl;
import cn.iocoder.yudao.module.system.api.oauth2.OAuth2TokenApi;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

@AutoConfiguration
public class YudaoMagicApiAutoConfiguration {

    @Bean
    public MagicApiDynamicConfig magicApiDynamicConfig() {
        return new MagicApiDynamicConfig();
    }
    @Bean
    public ResultProviderConfig resultProviderConfig() {
        return new ResultProviderConfig();
    }
    @Bean
    public DateFunction dateFunction() {
        return new DateFunction();
    }
    @Bean
    public LocalDateTimeFunction localDateTimeFunction() {
        return new LocalDateTimeFunction();
    }
    @Bean
    public MapFunction mapFunction() {
        return new MapFunction();
    }
    @Bean
    public AuthorizationInterceptorCustom authorizationInterceptorCustom(OAuth2TokenApi oauth2TokenApi) {
        return new AuthorizationInterceptorCustom(oauth2TokenApi);
    }
    @Bean
    public RequestInterceptorCustom requestInterceptorCustom() {
        return new RequestInterceptorCustom();
    }
    @Bean
    public SQLInterceptorCustom sqlInterceptorCustom() {
        return new SQLInterceptorCustom();
    }
    @Bean
    public TableInterceptorCustom tableInterceptorCustom() {
        return new TableInterceptorCustom();
    }
    @Bean
    public MagicApiExcuse magicApiExcuse() {
        return new MagicApiExcuseImpl();
    }
}
